#include "../src/seqqueue/seqqueue.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

/* 声明底层链表的函数库 */
extern func_SeqQueue fun_SeqQueue;

#define CAPACITY 10

int main(int argc, const char *argv[])
{
    int i = 0;
    int a[CAPACITY] = {0};

    SeqQueue *queue = fun_SeqQueue.create(CAPACITY);

    if (queue == NULL)
        return -1;

    // 压队列
    for (i = 0; i < CAPACITY - 1; i++)
    {
        a[i] = i + 1;
        fun_SeqQueue.append(queue, &a[i]);
    }

    printf("最大容量为 ： %d\n", fun_SeqQueue.capacity(queue));
    printf("目前长度为 ： %d\n", fun_SeqQueue.length(queue));
    printf("队列顶数据为 ： %d\n", *((int *)fun_SeqQueue.header(queue)));
    printf("\n");

    while (fun_SeqQueue.length(queue) > 0)
    {
        printf("出队列的数据为 ：%d\n", *((int *)fun_SeqQueue.subtract(queue)));
    }

    printf("\n");

    return 0;
}
